import http from '../../util/request.js';
//获取应用实例
var app = getApp();
Page({
    data: {
        userInfo : {},
        OrderStatus:'',
        statOrder:[],
    },

    onLoad: function () {
        var that = this;
        var userinfo=wx.getStorageSync('userInfo');
        console.log(userinfo);
        if (!userinfo){
          app.util.getUserInfo(function(e){
            this.setData({ userinfo: data });
          });
        }else{
          this.setData({ userinfo: data });
        }
    },
    onShow: function () {
      this.onLoad();
    },

    memberInfo:function(){
       var that = this;
       if (that.data.userInfo.fail==-1){
          wx.showToast({
              title: '请先登录',
              icon: 'success',
              duration: 2000
          })
       }else{
          wx.navigateTo({
              url: '../memberInfo/memberInfo',
          })
       }
    },

    favorite: function () {
      var that = this;
      if (that.data.userInfo.fail == -1) {
        wx.showToast({
          title: '请先登录',
          icon: 'success',
          duration: 2000
        })
      } else {
        wx.navigateTo({
          url: '../favorite/favorite',
        })
     }
    },

});
